import requests

url = 'https://www.baidu.com'

resp = requests.get(url=url)
print(resp.url) # 打印响应的url
print(resp.request.headers) # 打印响应对象的请求头
print(resp.headers) # 打印响应头
print(resp.status_code) # 打印响应的状态码
print(resp.request._cookies)# 打印请求携带的cookies
print(resp.cookies)# 打印响应中携带的cookies
